<%@ page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/taglibs.jsp"%>

<html>
	<head>
		<link href="${ctx}/css/main.css" rel="stylesheet" type="text/css" />
	</head>
	<script language="javascript">
		var message = '${message}';
		if(message != ''){
			alert(message);
		}
		
		function submitAction(action){
			document.filterWordForm.action = action ;
			document.filterWordForm.submit();
		}
		
		function doDelete(action,word){
			if(confirm('是否确认删除？')){
				location.href = "${ctx}/" + action + "?word=" + word;
			}
		}
		
		function saveAction(action){
			if(document.getElementById('word').value == ''){
				alert('请输入过滤词');
				return false;
			}
			submitAction(action)
		}
		
		function init() {
			document.getElementById('word').value = '';
		}
	</script>

	<body>
		<form method="post" action="" name="filterWordForm">
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="20%" class="td2"> 
						过滤词 <span style="color:red;vertical-align:middle;">*</span> 
					</td>
					<td width="30%" class="td2">
						<input type="text" name="word" size="32" value="${filterWord.word}">
					</td>
					<td width="20%" class="td2"> 
					</td>
					<td width="30%" class="td2">
					</td>
				</tr>
				<tr>
					<td class="td11" align="left" colspan="4">
						<input type="button" name="find" value="查询" onClick="submitAction('filterWordsManage.ac');">
						&nbsp;&nbsp;<input type="button" name="new" value="添加" onClick="saveAction('filterWordSave.ac');">
						&nbsp;&nbsp;<input type="button" name="reset" value="重置" onClick="init();">
					</td>
				</tr>
			</table>
			<BR>
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td width="75%" class="td1" align="center">
						已添加过滤词语
					</td>
					<td width="25%" class="td1" align="center">
						删除
					</td>
				</tr>
				<c:forEach var="filterWord" items="${filterWordList}">
					<tr>
						<td class="td2"  align="center">
							${filterWord.word}
						</td>
						<td class="td2" align="center">
							<img src="${ctx}/images/delete0.png" onclick="javascript:doDelete('deleteFilterWord.ac','${filterWord.word}');">
						</td>
					</tr>
				</c:forEach>
			</table>
		</form>
	
	</body>
</html>